using System;
using System.Collections.Generic;
using System.Text;

namespace Mud.Common.Physical
{

    /// <summary>
    /// Represents a rectangle.
    /// </summary>
    public struct Rectangle
    {
        #region Properties


        /// <summary>
        /// Gets or sets the width.
        /// </summary>
        public int Width
        {
            get { return _width; }
            set { _width = value; }
        }
        private int _width;

        /// <summary>
        /// Gets or sets the height.
        /// </summary>
        public int Height
        {
            get { return _height; }
            set { _height = value; }
        }
        private int _height;


        /// <summary>
        /// Gets or sets the X coordinate.
        /// </summary>
        public int X
        {
            get { return _x; }
            set { _x = value; }
        }
        private int _x;



        /// <summary>
        /// Gets or sets the Y coordinate.
        /// </summary>
        public int Y
        {
            get { return _y; }
            set { _y = value; }
        }
        private int _y;

        /// <summary>
        /// Gets the left edge distance.
        /// </summary>
        public int Left
        {
            get { return _x; }
        }


        /// <summary>
        /// Gets the top edge distance.
        /// </summary>
        public int Top
        {
            get { return _y; }
        }


        /// <summary>
        /// Gets the right edge distance.
        /// </summary>
        public int Right
        {
            get { return _x + _width; }
        }


        /// <summary>
        /// Gets the bottom edge distance.
        /// </summary>
        public int Bottom
        {
            get { return _y + _height; }
        }


        #endregion

        /// <summary>
        /// Initializes a new instance of the <see cref="Rectangle"/> class.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <param name="y">The y.</param>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        public Rectangle(int x, int y, int width, int height)
        {
            _x = x;
            _y = y;
            _width = width;
            _height = height;
        }
 
    }
}
